/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Client;

import java.awt.Component;
import java.awt.Graphics;
import java.awt.MediaTracker;
import java.util.Vector;

/**
 *
 * @author spok
 */
public class GamePanel extends javax.swing.JPanel {
    private Component gameFrame;

    
    Vector <ScreenElement> elementi;
            
    public GamePanel()
    {
       super();
       elementi = new Vector <ScreenElement> ();
    }
    
    private void initComponents() {
        
                
    }

    public void viewOutput(Vector <ScreenElement> elems)
{ 
    MediaTracker tracker=new MediaTracker(gameFrame);
    elementi  = elems;
    for(ScreenElement e: elems)
    {
       // tracker.addImage(e.image.image,0);
        try{ tracker.waitForID(0);} catch (Exception ex) {}
        
    }
    }
    
    @Override
    public void repaint()
    {
     super.repaint();
    }
    
    public void paintComponent(Graphics g)
    {
         super.paintComponent(g);
          for(ScreenElement e: elementi)
        {
              //g.drawImage(e.image.image,e.position.x,e.position.y,null);
        }
    }
}
